<template>
	<view class="round-2 mx-32 my-24" style="background-color: white;">
		<view class="flex pa-24 py-12 flex-between" style="border-bottom: 1px solid #f5f5f5;align-items: center;">
			<view class="flex flex-center">
				<tm-icon :name="icon" color="#5a94f6" class="mr-15" :font-size="40"></tm-icon>
				<tm-text :font-size="32" _class="" :label="`${code}`" color="red"></tm-text>
			</view>
			<slot name="btn">
				<tm-button @click="gotoList(url)" size="mini" :label="label" :padding="[10,20]" :width="100" :round="6" :fontSize="28"></tm-button>
			</slot>
		</view>
		<view class="flex flex-between pt-12 pl-24 pb-12 pr-24" style="align-items: center;">
			<view style="width: 100%" @click="gotoList(url)">
				<slot></slot>
			</view>
		</view>
	</view>
</template>

<script setup lang='ts'>

	const props = defineProps({
		data:{
			type:Object,
			require:true
		},
		url:{
			type:String,
			default:'',
		},
		code:{
			type:String,
			default:''
		},
		label:{
			type:String,
			default:'办理'
		},
		icon:{
			type:String,
			default:'tmicon-ios-filing'
		}
	})

	const gotoList = () => {
		if(props.url){
			uni.navigateTo({
				url:props.url
			})
		}
	}
</script>

<style>

</style>
